<!-- I took this code from somewhere, just can recall now. -->

<script type="text/javascript">  
  function toggleGrid() {
    var toggle = document.getElementById('toggleGrid');
    var container;
    if(toggle.innerHTML == 'Hide Grid') {
      toggle.innerHTML = 'Show Grid';
      ripClass('');
    } 
    else if(toggle.innerHTML == 'Show Grid') {
      toggle.innerHTML = 'Hide Grid';
      ripClass(' showgrid');
    }
  }
  
  function ripClass(c) {
    if(document.getElementsByClassName) {
      container = document.getElementsByClassName('container');
      for(var i=0; i < container.length; i++) {
        container[i].className = 'container' + c;
      }
    }
    else {
      container = document.getElementsByTagName('div');
      for(var i=0; i < container.length; i++) {
        if(container[i].className == 'container') {
          container[i].className = 'container' + c;
        }
        else if(container[i].className == 'container showgrid') {
          container[i].className = 'container';
        }
      }
    }
  }
</script>
<style type="text/css">
  div#toggleGrid {
    color: #fff;
    cursor: pointer;
    background: #333;
    font-weight: bold;
    left: 0;
    position: fixed;	
    text-align: center;
    top: 0;
    width: 100px;		
  }
  div#toggleGrid:hover {
    color: #FF6F6F;
  }
</style>

<!-- Append this anywhere on the body. -->
<div id="toggleGrid" onclick="toggleGrid();">Show Grid</div>